<template>
  <div class="ceshi-">
    测试
  </div>
</template>

<script>
import { concurrencyRequest } from '@/utils/concurrentRequest'
import Socket from '@/utils/websocketBase'
export default {
  name: 'CeshiBase',
  created () {
    // this.runConRequest()
    // console.log('kkk-')
    const ws = new Socket('ws://127.0.0.1:8080', {
      reconnect: true
    })
    ws.init()
  },
  methods: {
    runConRequest () {
      const requests = []
      for (let i = 1; i <= 20; i++) {
        requests.push(() => fetch(`https://jsonplaceholder.typicode.com/todos/${i}`))
      }
      concurrencyRequest(requests, 5).then(res => {
        console.log('hhhhh---', res)
      })
    }
  }

}
</script>
